package JiHeDemo.mygenneric;

import java.util.TreeSet;

public class Set3 {
	public static void main(String[] args) {
		TreeSet<String> set = new TreeSet<String>((o1, o2) -> {
			int n1 = o1.length() - o2.length();
			int n2 = o1.compareTo(o2);
			return n1 == 0 ? n2 : n1;
		});
		set.add("hello");
		set.add("hello123");
		set.add("java");
		set.add("abcd");
		set.add("n");
		set.add("xiangjiaov");
		System.out.println(set);
	}
}
